package org.example.reactive.demo3.config;

import org.example.reactive.demo3.handler.ChatSocketHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.HandlerMapping;
import org.springframework.web.reactive.handler.SimpleUrlHandlerMapping;


import java.util.Map;

/**
 * @author Gong.Yang
 */
@Configuration
public class HandlerConfig {
    @Bean
    public HandlerMapping chatSocketHandlerMapping(ChatSocketHandler handler){
        return new SimpleUrlHandlerMapping(Map.of("/chat", handler), -1);
    }
}
